<template>
	<view class="box" :style="theme">
		<!-- 倒计时 -->
		<view v-if="time > 0 && orderType!=5" class="box_time">
			<image :src="imgHost+'/order_ic_time.png'"></image>
			剩余支付时间<u-count-down :time="time" @finish="finish">
				<view class="time"><text class="time__item">{{ timeData.minutes }}&nbsp;分</text>
					<text class="time__item">{{ timeData.seconds }}&nbsp;秒</text>
				</view>
			</u-count-down>，请尽快付款哦~
		</view>
		<view v-else style="height: 110rpx;"></view>
		<view class="cont">
			<view class="venueName">
				<image :src="imgHost+'/ic_changguan.png'" mode="widthFix" class="locationImg"></image>
				{{desc.venueName}}
			</view>
			<view v-if="desc.moduleInfo && desc.moduleInfo.detailList && desc.moduleInfo.detailList.length > 0"
				class="orderDetail">
				<view v-for="(em, ss) in desc.moduleInfo.detailList" :key="ss" class="detail flex">
					<image v-if="em.imgUrl" :src="em.imgUrl" class="left"></image>
					<image v-else-if="desc.orderType=='11'" :src="imgHost+'/default_duibi.png'" class="left"></image>
					<image v-else-if="desc.orderType=='05'" :src="imgHost+'/default_kaika.png'" class="left"></image>
					<image v-else-if="desc.orderType=='13'" :src="imgHost+'/default_shunjian.png'" class="left"></image>
					<image v-else-if="desc.orderType=='04' || desc.orderType=='03'" :src="imgHost+'/default_ticket.png'"
						class="left"></image>
					<image v-else-if="desc.orderType=='01'" :src="imgHost+'/default_chongzhi.png'" class="left"></image>
					<image v-else :src="imgHost+'/default_tongyong.png'" class="left"></image>
					<view class="right">
						<view class="name flex flex_between">
							<view class="limit-1-line">{{em.name}}</view>
							<view
								v-if="desc.orderType!='02' && desc.orderType!='03' &&desc.orderType!='04' &&desc.orderType!='07' && desc.orderType!='08'">
								¥{{em.realPrice || em.realPrice === 0?em.realPrice:em.price}}
								<text v-if="em.realPrice || em.realPrice === 0">¥{{em.price}}</text>
							</view>
						</view>
						<view class="time flex flex_between">
							<view v-if="em.skuInfo" class="limit-1-line">
								{{desc.orderType == '11'?'设备':desc.orderType == '05'?'开卡等级':'规格'}}：{{em.skuInfo}}
							</view>
							<view v-else-if="em.useTime" class="limit-1-line">
								{{desc.orderType == '08'?'活动时间':desc.orderType == '07'?'课程时间':desc.orderType == '04'?'有效期':'适用时间'}}：{{em.useTime}}
							</view>
							<view v-else-if="em.useItem" class="limit-1-line">
								{{desc.orderType == '03'?'设备': desc.orderType=='07'?'项目':'规格'}}：{{em.useItem}}
							</view>
							<view v-else class="limit-1-line"></view>
						</view>

						<u-read-more ref="uReadMore" :color="color" showHeight="36rpx" :shadowStyle="shadowStyle" toggle
							closeText="展开" textIndent="0" fontSize="24rpx">
							<view v-if="(em.useTime && em.useItem) || (em.skuInfo && em.useItem)" class="time">
								适用项目：{{em.useItem}}
							</view>
						</u-read-more>
						<view
							v-if="desc.orderType=='02'|| desc.orderType=='03'|| desc.orderType=='04'|| desc.orderType=='07'|| desc.orderType=='08'"
							class="flex flex_between tj">
							<view class="price">
								¥{{desc.orderType=='07'?(desc.originalPrice/em.num).toFixed(2):em.realPrice || em.realPrice === 0?em.realPrice:em.price }}
								<text v-if="em.realPrice || em.realPrice === 0">¥{{em.price}}</text>
							</view>
							<view v-if="em.num" class="num">x{{em.num}}</view>
						</view>
					</view>
				</view>
			</view>
			<view class="cnt flex flex_between">
				订单总价<text>¥{{desc.originalPrice }}</text>
			</view>
			<view v-if="desc.realPrice && desc.realPrice != desc.originalPrice" class="cnt flex flex_between">
				优惠金额<text class="yh">-¥{{(desc.originalPrice - desc.realPrice).toFixed(2) }}</text>
			</view>
			<view class="cnt flex flex_between">
				{{desc.payStatus == 0 || desc.payStatus == 2?'需付款':'实付款'}}
				<text>¥{{desc.realPrice || desc.realPrice === 0?desc.realPrice:desc.originalPrice}}</text>
			</view>
		</view>

		<view v-if="desc.orderType=='07' && desc.moduleInfo.detailList" class="box_mode" style="padding-bottom: 30rpx;">
			<view class="box_mode_title"><text>报名信息</text></view>
			<view class="flex flex_between mt30">
				<text class="c6 f28">课程名称</text>
				<text class="f28 c3">{{desc.moduleInfo.detailList[0].name}}</text>
			</view>
			<view v-if="desc.moduleInfo.teacherName" class="flex flex_between mt20">
				<text class="c6 f28">上课教练</text>
				<text class="f28 c3">{{desc.moduleInfo.teacherName}}</text>
			</view>
			<view v-if="desc.moduleInfo.studentName && desc.moduleInfo.studentName != 'null'"
				class="flex flex_between mt20">
				<text class="c6 f28">上课学员</text>
				<text class="f28 c3">{{desc.moduleInfo.studentName}}</text>
			</view>
			<view v-if="desc.moduleInfo.classTime" class="flex flex_between mt20">
				<text class="c6 f28">上课时间</text>
				<text class="f28 c3">{{desc.moduleInfo.classTime}}</text>
			</view>
			<view v-if="desc.moduleInfo.siteName" class="flex flex_between mt20">
				<text class="c6 f28">上课地点</text>
				<text class="f28 c3">{{desc.moduleInfo.siteName}}</text>
			</view>
		</view>
		<!-- 支付方式 -->
		<view class="box_mode">
			<view class="box_mode_title"><text>支付方式</text></view>
			<radio-group @change="radioChange">
				<block v-for="(item, index) in items" :key="index">
					<label v-if="!(item.checked === '1' && !yhqNum)" class="box_mode_s" @click="clickYH(item)">
						<view class="weui-cell__bd">
							<image :src="imgHost + item.url"></image>
							<text>{{item.name}}</text>
							<text v-if="item.balance">(余额：￥{{userInfo.money || 0}})</text>
						</view>
						<view class="weui-cell__hd">
							<text v-if="item.checked === '1'">{{yhqName?yhqName:yhqNum+'张可用'}}</text>
							<text
								v-if="item.checked === '3'">{{mealsMemberName?mealsMemberName:numb?numb+'张可用':'暂无可用'}}</text>
							<u-icon class="my-icon" v-if="item.checked === '1'" name="arrow-right" color="#666666"
								size="45rpx" />
							<u-icon class="my-icon" v-if="item.checked === '3'" name="arrow-right" color="#666666"
								size="45rpx" />
							<radio v-if="item.checked !== '1' && item.checked !== '3'" :value="item.value"
								:checked="item.checked" />
						</view>
					</label>
				</block>
				<label v-if="useIntegral && useAmot" class="box_mode_s">
					<view class="weui-cell__bd">
						<text>是否使用{{useIntegral}}积分抵扣{{useAmot}}元</text>
					</view>
					<view class="weui-cell__bd">
						<checkbox-group @change="checkboxChange">
							<checkbox class="checkbox-backgroun-color" value="pd" :checked="integralUse == '1'" />
						</checkbox-group>
					</view>
				</label>
				<label v-if="policyName && policyId" class="box_mode_s">
					<view class="weui-cell__bd">
						<text style="color: #666666;font-size: 26rpx">优惠政策</text>
					</view>
					<view class="weui-cell__hd">
						<text>{{policyName}}</text>
					</view>
				</label>
			</radio-group>
		</view>
		<view v-if="dcxz" class="box_mode mt3" style="padding-bottom: 30rpx;">
			<view class="box_mode_title mb3"><text>订场须知</text></view>
			<u-parse :content="dcxz"></u-parse>
		</view>
		<!-- 展位 -->
		<view class="seizeAseat"></view>
		<!-- 底部总金额+提交 -->
		<view class="box_active_footer">
			<view class="box_active_footer_money">
				<!-- desc.totalAmount || desc.allPrice -->
				<text>实付：<text class="reds">¥{{integralUse=='1'?paidInb:paidIn}}</text></text>
				<text>优惠金额：¥ {{integralUse=='1'?yhpriceb:yhprice}}</text>
			</view>
			<view class="box_active_footer_btn flex" @click="$noMultipleClicks(submit)">
				<view>提交订单</view>
			</view>
		</view>
		<!-- 密码弹框 -->
		<u-popup round :show="show" mode="center" round="20rpx">
			<view class="pwd_box">
				<view class="pwd_box_title">支付密码</view>
				<view class="pwd_box_input">
					<input type="password" placeholder="请输入支付密码" v-model="pwd" maxlength="6" />
				</view>
				<view class="wjmm" @click="jump2('/pages/member/password')">忘记密码?</view>
				<view class="pwd_box_footer">
					<view class="pwd_box_footer_qx" @click="onClose">取消</view>
					<view class="pwd_box_footer_qd" @click="huiyuanZF">确定</view>
				</view>
			</view>
		</u-popup>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				noClick: true,
				orderType: '',
				id: '', //票id
				num: '', //购买数量
				yhqNum: 0, //优惠券数量
				numb: 0, //次卡数量
				time: 0, //计时时间
				date: '', //当天年月日星期
				balance: 0, //余额
				rq: '', //当前日期
				desc: {}, //详情数据
				pwd: '', //会员支付密码
				show: false, //控制密码弹框显示隐藏
				orderId: '', //订单id
				type: '01', //支付方式
				yhqId: '', //优惠券id
				yhqName: '',
				yhprice: 0, //会员优惠
				yhpriceb: 0, //会员优惠
				paidInb: 0,
				dcxz: '',
				timeData: {},
				paidIn: 0, //实际支付价
				items: [ //支付配置项
					{
						value: '01',
						name: '会员卡',
						url: '/order_ic_vipcard.png',
						balance: 200,
						checked: true
					},
					{
						value: '03',
						name: '微信',
						url: '/order_ic_wepay.png',
						checked: false
					},
					// {
					// 	value: '11',
					// 	name: '银联支付',
					// 	url: '/order_ic_wepay.png',
					// 	checked: false
					// },
					{
						value: '2',
						name: '优惠券',
						url: '/order_ic_coupon.png',
						checked: '1'
					},
				],
				policyId: '',
				policyName: '',
				mealsMemberId: '',
				mealsMemberName: '',
				useIntegral: '',
				useAmot: '',
				businessId: '',
				integralUse: '0',
				payOrder: 0, // 判断是否订单页面进入
				payPd: false // 判断是否支付
			}
		},
		onLoad(ops) {
			let color = this.$app.ztColor()
			uni.setNavigationBarColor({
				frontColor: '#ffffff',
				backgroundColor: color // 导航栏背景颜色
			});
			this.orderId = ops.orderId
			this.businessId = ops.businessId
			this.orderType = ops.type
			if (ops.type == 1) {
				this.getYx()
			}
			if (ops.payOrder) {
				this.payOrder = ops.payOrder || 0
			}
			this.getDetail()
			this.getMemberInformation()
			this.getDate()
		},
		onShow() {
			this.getZf()
		},
		onUnload() {
			if (this.payOrder != 1 && this.orderType != 5 && !this.payPd) {
				this.bookingCancellation()
			}
		},
		methods: {
			jump(url, params, a) {
				this.$app.jump(url, params, a);
			},
			jump2(url, params, a) {
				this.$app.jump2(url, params, a);
			},
			jump3(url, params, a) {
				this.payPd = true
				this.$app.jump3(url, params, a);
			},
			onChange(e) {
				this.timeData = e
			},
			getMemberInformation() {
				this.$app.ajax({
					data: {
						param: {}
					},
					api: this.$api.memberInformation()
				}).then((res) => {
					if (res.errorCode === '000000') {
						this.$store.commit('saveUserInfo', res.record);
					}
				}).catch(() => {})
			},
			bookingCancellation() {
				if (this.orderType == 1) {
					this.$app.ajax({
						api: this.$api.bookingCancellation(),
						data: {
							userId: this.userInfo.id,
							param: {
								closeOrder: '1',
								reserveAndOrderId: this.businessId
							}
						}
					}).then((res) => {}).catch(() => {})
				} else if (this.orderType == 3) {
					this.$app.ajax({
						api: this.$api.cancelTicketOrder(),
						data: {
							userId: this.userInfo.id,
							param: {
								closeOrder: '1',
								id: this.orderId
							}
						}
					}).then((res) => {}).catch(() => {})
				} else if (this.orderType == 4) {
					this.$app.ajax({
						api: this.$api.mealsOnlionCanlPay(),
						data: {
							userId: this.userInfo.id,
							param: {
								closeOrder: '1',
								id: this.orderId
							}
						}
					}).then((res) => {}).catch(() => {})
				} else if (this.orderType == 2) {
					this.$app.ajax({
						api: this.$api.noEnrollCourse(),
						data: {
							userId: this.userInfo.id,
							param: {
								closeOrder: '1',
								orderId: this.orderId
							}
						}
					}).then((res) => {}).catch(() => {})
				} else if (this.orderType == 5) {
					this.$app.ajax({
						api: this.$api.goodsQxzf(),
						data: {
							userId: this.userInfo.id,
							param: {
								closeOrder: '1',
								id: this.orderId
							}
						}
					}).then((res) => {}).catch(() => {})
				} else if (this.orderType == 6) {
					this.$app.ajax({
						api: this.$api.activityOrderCancelPayMini(),
						data: {
							userId: this.userInfo.id,
							param: {
								closeOrder: '1',
								orderId: this.orderId
							}
						}
					}).then((res) => {}).catch(() => {})
				}
			},
			checkboxChange() {
				if (this.integralUse == '0') {
					this.integralUse = '1'
				} else {
					this.integralUse = '0'
				}
			},
			// 倒计时结束
			finish() {
				let that = this
				uni.showToast({
					title: '超时未支付',
					icon: 'none',
					mask: true,
					duration: 2000,
					success(res) {
						// setTimeout(() => {
						// 	that.jump('/pages/index/index', '', 1)
						// }, 2000)
					}
				})
			},
			getYx() {
				this.$app.ajax({
					data: {
						param: {
							type: '15',
							code: 'AGREEMENT_BOOKING_SITE'
						}
					},
					api: this.$api.paymentConfiguration()
				}).then((res) => {
					if (res.errorCode === '000000') {
						this.dcxz = res.recordList[0].value
					}
				}).catch(() => {})
			},
			getMealsReserveCard() {
				this.$app.ajax({
					data: {
						userId: this.userInfo.id,
						param: {
							memberId: this.userInfo.id,
							orderId: this.orderId,
						}
					},
					api: this.$api.getMealsReserveCard()
				}).then((res) => {
					if (res.errorCode === '000000') {
						if (res.record && res.record.length > 0) {
							this.numb = res.record.length
						} else {
							this.numb = 0
						}
					}
				}).catch(() => {})
			},
			onClose() {
				this.show = false
			},
			// 会员支付
			huiyuanZF() {
				if (!this.pwd) {
					this.$app.showToast('请输入支付密码')
					return false
				}
				let x = /^[0-9]{6,6}$/gim;
				if (!(x.test(this.pwd))) {
					this.$app.showToast('请输入6位数字密码')
					return false
				}
				this.$app.ajax({
					data: {
						param: {
							couponsId: this.yhqId,
							memberId: this.userInfo.id,
							orderId: this.orderId,
							mealsMemberId: this.mealsMemberId,
							integralUse: this.integralUse,
							policyId: this.policyId,
							payPwd: this.pwd,
							payMethod: this.type
						}
					},
					api: this.$api.payment()
				}).then((res) => {
					if (res.errorCode === '000000') {
						this.$app
							.showToast(
								'支付成功')
						setTimeout(
							() => {
								this.jump3('/pages/order/success?type=', this.orderType + '&orderId=' + this
									.orderId + '&businessId=' + this.businessId)
							}, 2000
						)
					}
				}).catch(() => {})
			},

			// 提交订单
			submit() {
				var that = this
				if (this.type === '01') {
					if ((this.integralUse == '1' && this.paidInb == 0) || (this.integralUse != '1' && this.paidIn == 0)) {
						// this.huiyuanZF()
						this.$app.ajax({
							data: {
								param: {
									couponsId: this.yhqId,
									memberId: this.userInfo.id,
									orderId: this.orderId,
									mealsMemberId: this.mealsMemberId,
									integralUse: this.integralUse,
									policyId: this.policyId,
									payPwd: '',
									payMethod: this.type
								}
							},
							api: this.$api.payment()
						}).then((res) => {
							if (res.errorCode === '000000') {
								this.$app
									.showToast(
										'支付成功')
								setTimeout(
									() => {
										this.jump3('/pages/order/success?type=', this.orderType + '&orderId=' +
											this
											.orderId + '&businessId=' + this.businessId)
									}, 2000
								)
							}
						}).catch(() => {})
						return false
					}
					this.show = true
				} else {
					this.$app.ajax({
						data: {
							param: {
								couponsId: this.yhqId,
								memberId: this.userInfo.id,
								mealsMemberId: this.mealsMemberId,
								orderId: this.orderId,
								integralUse: this.integralUse,
								policyId: this.policyId,
								payMethod: this.type
							}
						},
						api: this.$api.payment()
					}).then((res) => {
						if (res.errorCode === '000000') {
							if ((this.integralUse == '1' && this.paidInb == 0) || (this.integralUse !=
									'1' && this.paidIn == 0)) {
								that.$app
									.showToast(
										'支付成功')
								that.jump3('/pages/order/success?type=', that.orderType + '&orderId=' + that
									.orderId + '&businessId=' + that.businessId)
								return false
							}
							let data = res.record
							uni.getProvider({
								service: 'payment',
								success: function(res) {
									uni.requestPayment({
										provider: 'wxpay', // 服务提提供商
										timeStamp: data.timeStamp,
										nonceStr: data.nonceStr,
										package: data.packageStr,
										signType: 'MD5',
										paySign: data.sign,
										success: function() {
											// 支付成功回调
											that.$app
												.showToast(
													'支付成功')
											that.jump3('/pages/order/success?type=', that
												.orderType + '&orderId=' + that
												.orderId + '&businessId=' + that
												.businessId)
										},
										fail: function(errb) {

										}
									});
								}
							});

						}
					}).catch(() => {})
				}
			},
			// 切换支付方式
			radioChange(e) {
				let items = []
				if (this.orderType == 1 || (this.orderType == 2 && this.desc.moduleInfo && this.desc.moduleInfo
						.courseType == '4')) {
					items = [ //支付配置项
						{
							value: '01',
							name: '会员卡',
							url: '/order_ic_vipcard.png',
							balance: 200,
							checked: true
						},
						{
							value: '03',
							name: '微信',
							url: '/order_ic_wepay.png',
							checked: false
						},
						// {
						// 	value: '11',
						// 	name: '银联支付',
						// 	url: '/order_ic_wepay.png',
						// 	checked: false
						// },
						{
							value: '3',
							name: '套餐课程卡',
							url: '/order_ic_cika.png',
							checked: '3'
						},
						{
							value: '2',
							name: '优惠券',
							url: '/order_ic_coupon.png',
							checked: '1'
						}
					]
				} else {
					items = [ //支付配置项
						{
							value: '01',
							name: '会员卡',
							url: '/order_ic_vipcard.png',
							balance: 200,
							checked: true
						},
						{
							value: '03',
							name: '微信',
							url: '/order_ic_wepay.png',
							checked: false
						},
						// {
						// 	value: '11',
						// 	name: '银联支付',
						// 	url: '/order_ic_wepay.png',
						// 	checked: false
						// },
						{
							value: '2',
							name: '优惠券',
							url: '/order_ic_coupon.png',
							checked: '1'
						}
					]
				}
				this.yhqId = ''
				this.yhqName = ''
				this.mealsMemberId = ''
				this.mealsMemberName = ''
				this.integralUse = '0'
				if (e.detail.value !== '') {
					this.type = e.detail.value
				}
				for (let i = 0; i < items.length; i++) {
					if (items[i].name === '优惠券' || items[i].name === '套餐课程卡') {
						continue;
					}
					items[i].checked = items[i].value === e.detail.value
				}
				this.items = items

				this.availableCoupons()
				if (this.orderType == 1 || (this.orderType == 2 && this.desc.moduleInfo && this.desc.moduleInfo
						.courseType == '4')) {
					this.getMealsReserveCard()
				}
				this.getPrice()
			},
			// 点击优惠券
			clickYH(e) {
				if (e.value == '2') {
					this.jump(`/pages/coupon/index?id=${this.orderId}&zfType=${this.type}&yhqId=${this.yhqId}`)
				} else if (e.value == '3') {
					this.jump(`/pages/coupon/combo?id=${this.orderId}&mealsMemberId=${this.mealsMemberId}`)
				}
			},
			// 获取日期
			getDate() {
				let date = new Date();
				let nnn = date.getFullYear()
				let yyy = date.getMonth() + 1
				let rrr = date.getDate()
				let xq = date.getDay()
				let data = ''
				switch (xq) {
					case 1:
						data = '周一'
						break;
					case 2:
						data = '周二'
						break;
					case 3:
						data = '周三'
						break;
					case 4:
						data = '周四'
						break;
					case 5:
						data = '周五'
						break;
					case 6:
						data = '周六'
						break;
					case 0:
						data = '周日'
						break;
				}
				let res = nnn + '年' + yyy + '月' + rrr + '日' + ' ' + data
				this.date = res
			},
			getPrice() {
				let that = this
				this.$app.ajax({
					api: this.$api.getPrice(),
					data: {
						userId: this.userInfo.id,
						param: {
							orderId: this.orderId,
							memberId: this.userInfo.id,
							mealsMemberId: this.mealsMemberId,
							couponsId: this.yhqId,
							payMethod: this.type
						}
					}
				}).then((res) => {
					if (res.errorCode === '000000') {
						let yhprice = Number(res.record.originalPrice - res.record.price).toFixed(2)
						let yhpriceb = (Number(yhprice) + Number(res.record.useAmot)).toFixed(2)
						let paidInb = (Number(res.record.price) - Number(res.record.useAmot)).toFixed(2)
						this.yhprice = yhprice
						this.yhpriceb = yhpriceb
						this.paidInb = paidInb
						this.paidIn = res.record.price
						this.policyId = res.record.policyId
						this.useIntegral = res.record.useIntegral
						this.useAmot = res.record.useAmot
					} else {
						if (res.errorCode == '70003') {
							setTimeout(() => {
								that.jump('/pages/index/index', '', 1)
							}, 2000)
						}
					}
				}).catch(() => {})

			},
			availableCoupons() {
				this.$app.ajax({
					api: this.$api.availableCoupons(),
					data: {
						param: {
							orderId: this.orderId,
							memberId: this.userInfo.id,
							payMethod: this.type,
							stadiumId: this.venueId
						}
					}
				}).then((res) => {
					if (res.errorCode === '000000') {
						this.yhqNum = res.totalCount || 0
					}
				}).catch(() => {})
			},
			getZf() {
				let that = this
				let pages = getCurrentPages();
				let currPage = pages[pages.length - 1]; //当前页面
				let yhqId = currPage.data.yhqId || '';
				let yhqName = currPage.data.yhqName || '';
				let mealsMemberId = currPage.data.mealsMemberId || '';
				let mealsMemberName = currPage.data.mealsMemberName || '';
				this.yhqId = yhqId
				this.mealsMemberId = mealsMemberId
				this.mealsMemberName = mealsMemberName
				this.yhqName = yhqName
				if (this.yhqId) {
					if (this.type == '03') {
						this.items = [{
								value: '01',
								name: '会员卡',
								url: '/order_ic_vipcard.png',
								balance: 200,
								checked: false
							},
							{
								value: '03',
								name: '微信',
								url: '/order_ic_wepay.png',
								checked: true
							},
							// {
							// 	value: '11',
							// 	name: '银联支付',
							// 	url: '/order_ic_wepay.png',
							// 	checked: false
							// },
							{
								value: '2',
								name: '优惠券',
								url: '/order_ic_coupon.png',
								checked: '1'
							}
						]
					} else if (this.type == '11') {
						this.items = [{
								value: '01',
								name: '会员卡',
								url: '/order_ic_vipcard.png',
								balance: 200,
								checked: false
							},
							{
								value: '03',
								name: '微信',
								url: '/order_ic_wepay.png',
								checked: false
							},
							// {
							// 	value: '11',
							// 	name: '银联支付',
							// 	url: '/order_ic_wepay.png',
							// 	checked: true
							// },
							{
								value: '2',
								name: '优惠券',
								url: '/order_ic_coupon.png',
								checked: '1'
							}
						]
					} else {
						this.items = [{
								value: '01',
								name: '会员卡',
								url: '/order_ic_vipcard.png',
								balance: 200,
								checked: true
							},
							{
								value: '03',
								name: '微信',
								url: '/order_ic_wepay.png',
								checked: false
							},
							// {
							// 	value: '11',
							// 	name: '银联支付',
							// 	url: '/order_ic_wepay.png',
							// 	checked: false
							// },
							{
								value: '2',
								name: '优惠券',
								url: '/order_ic_coupon.png',
								checked: '1'
							}
						]
					}

				} else if (this.mealsMemberId) {
					if (this.type == '03') {
						this.items = [ //支付配置项
							{
								value: '01',
								name: '会员卡',
								url: '/order_ic_vipcard.png',
								balance: 200,
								checked: false
							},
							{
								value: '03',
								name: '微信',
								url: '/order_ic_wepay.png',
								checked: true
							},
							// {
							// 	value: '11',
							// 	name: '银联支付',
							// 	url: '/order_ic_wepay.png',
							// 	checked: false
							// },
							{
								value: '3',
								name: '套餐课程卡',
								url: '/order_ic_cika.png',
								checked: '3'
							}
						]
					} else if (this.type == '11') {
						this.items = [ //支付配置项
							{
								value: '01',
								name: '会员卡',
								url: '/order_ic_vipcard.png',
								balance: 200,
								checked: false
							},
							{
								value: '03',
								name: '微信',
								url: '/order_ic_wepay.png',
								checked: false
							},
							// {
							// 	value: '11',
							// 	name: '银联支付',
							// 	url: '/order_ic_wepay.png',
							// 	checked: true
							// },
							{
								value: '3',
								name: '套餐课程卡',
								url: '/order_ic_cika.png',
								checked: '3'
							}
						]
					} else {
						this.items = [ //支付配置项
							{
								value: '01',
								name: '会员卡',
								url: '/order_ic_vipcard.png',
								balance: 200,
								checked: true
							},
							{
								value: '03',
								name: '微信',
								url: '/order_ic_wepay.png',
								checked: false
							},
							// {
							// 	value: '11',
							// 	name: '银联支付',
							// 	url: '/order_ic_wepay.png',
							// 	checked: false
							// },
							{
								value: '3',
								name: '套餐课程卡',
								url: '/order_ic_cika.png',
								checked: '3'
							}
						]
					}

				} else if (this.orderType == 1 || (this.orderType == 2 && this.desc.moduleInfo && this.desc.moduleInfo
						.courseType == '4')) {
					if (this.type == '03') {
						this.items = [ //支付配置项
							{
								value: '01',
								name: '会员卡',
								url: '/order_ic_vipcard.png',
								balance: 200,
								checked: false
							},
							{
								value: '03',
								name: '微信',
								url: '/order_ic_wepay.png',
								checked: true
							},
							// {
							// 	value: '11',
							// 	name: '银联支付',
							// 	url: '/order_ic_wepay.png',
							// 	checked: false
							// },
							{
								value: '3',
								name: '套餐课程卡',
								url: '/order_ic_cika.png',
								checked: '3'
							},
							{
								value: '2',
								name: '优惠券',
								url: '/order_ic_coupon.png',
								checked: '1'
							}
						]
					} else if (this.type == '11') {
						this.items = [ //支付配置项
							{
								value: '01',
								name: '会员卡',
								url: '/order_ic_vipcard.png',
								balance: 200,
								checked: false
							},
							{
								value: '03',
								name: '微信',
								url: '/order_ic_wepay.png',
								checked: false
							},
							// {
							// 	value: '11',
							// 	name: '银联支付',
							// 	url: '/order_ic_wepay.png',
							// 	checked: true
							// },
							{
								value: '3',
								name: '套餐课程卡',
								url: '/order_ic_cika.png',
								checked: '3'
							},
							{
								value: '2',
								name: '优惠券',
								url: '/order_ic_coupon.png',
								checked: '1'
							}
						]
					} else {
						this.items = [ //支付配置项
							{
								value: '01',
								name: '会员卡',
								url: '/order_ic_vipcard.png',
								balance: 200,
								checked: true
							},
							{
								value: '03',
								name: '微信',
								url: '/order_ic_wepay.png',
								checked: false
							},
							// {
							// 	value: '11',
							// 	name: '银联支付',
							// 	url: '/order_ic_wepay.png',
							// 	checked: false
							// },
							{
								value: '3',
								name: '套餐课程卡',
								url: '/order_ic_cika.png',
								checked: '3'
							},
							{
								value: '2',
								name: '优惠券',
								url: '/order_ic_coupon.png',
								checked: '1'
							}
						]
					}
				} else {
					if (this.type == '03') {
						this.items = [{
								value: '01',
								name: '会员卡',
								url: '/order_ic_vipcard.png',
								balance: 200,
								checked: false
							},
							{
								value: '03',
								name: '微信',
								url: '/order_ic_wepay.png',
								checked: true
							},
							// {
							// 	value: '11',
							// 	name: '银联支付',
							// 	url: '/order_ic_wepay.png',
							// 	checked: false
							// },
							{
								value: '2',
								name: '优惠券',
								url: '/order_ic_coupon.png',
								checked: '1'
							}
						]
					} else if (this.type == '11') {
						this.items = [{
								value: '01',
								name: '会员卡',
								url: '/order_ic_vipcard.png',
								balance: 200,
								checked: false
							},
							{
								value: '03',
								name: '微信',
								url: '/order_ic_wepay.png',
								checked: false
							},
							// {
							// 	value: '11',
							// 	name: '银联支付',
							// 	url: '/order_ic_wepay.png',
							// 	checked: true
							// },
							{
								value: '2',
								name: '优惠券',
								url: '/order_ic_coupon.png',
								checked: '1'
							}
						]
					} else {
						this.items = [{
								value: '01',
								name: '会员卡',
								url: '/order_ic_vipcard.png',
								balance: 200,
								checked: true
							},
							{
								value: '03',
								name: '微信',
								url: '/order_ic_wepay.png',
								checked: false
							},
							// {
							// 	value: '11',
							// 	name: '银联支付',
							// 	url: '/order_ic_wepay.png',
							// 	checked: false
							// },
							{
								value: '2',
								name: '优惠券',
								url: '/order_ic_coupon.png',
								checked: '1'
							}
						]
					}
				}
				if (this.orderId) {
					this.getPrice()
				}
			},
			getDetail() {
				this.$app.ajax({
					api: this.$api.myOrderDetail(),
					data: {
						param: {
							orderId: this.orderId
						}
					}
				}).then((res) => {
					if (res.errorCode === '000000') {
						this.desc = res.record
						this.time = res.record.payTime
						console.log(1231, this.orderType, res.record.moduleInfo)
						if (this.orderType == 1 || (this.orderType == 2 && res.record.moduleInfo.courseType ==
							'4')) {
							this.getMealsReserveCard()
						}
						this.getZf()
						this.availableCoupons()

					} else {
						setTimeout(() => {
							uni.navigateBack({
								delta: 1
							})
						}, 100)
					}
				}).catch((err) => {
					console.log('err', err)
				})
				// if (this.orderType == 1) {
				// 	this.$app.ajax({
				// 		api: this.$api.bookingDetails(),
				// 		data: {
				// 			userId: this.userInfo.id,
				// 			param: {
				// 				businessId: this.businessId
				// 			}
				// 		}
				// 	}).then((res) => {
				// 		if (res.errorCode === '000000') {
				// 			this.desc = res.record
				// 			this.orderId = res.record.orderId
				// 			this.time = res.record.surpluTime
				// 			this.getMealsReserveCard()
				// 			this.getPrice()
				// 			this.availableCoupons()
				// 		} else {
				// 			setTimeout(() => {
				// 				uni.navigateBack({
				// 					delta: 1
				// 				})
				// 			}, 100)
				// 		}
				// 	}).catch(() => {})
				// } else if (this.orderType == 2) {
				// 	this.$app.ajax({
				// 		api: this.$api.myOrderDetail(),
				// 		data: {
				// 			param: {
				// 				orderId: this.orderId
				// 			}
				// 		}
				// 	}).then((res) => {
				// 		if (res.errorCode === '000000') {
				// 			this.desc = res.record
				// 			this.time = res.record.payTime
				// 			this.getPrice()
				// 			this.availableCoupons()
				// 		} else {
				// 			setTimeout(() => {
				// 				uni.navigateBack({
				// 					delta: 1
				// 				})
				// 			}, 100)
				// 		}
				// 	}).catch((err) => {
				// 		console.log('err', err)
				// 	})
				// 	// this.$app.ajax({
				// 	// 	api: this.$api.courseContinuePayForMini(),
				// 	// 	data: {
				// 	// 		userId: this.userInfo.id,
				// 	// 		param: {
				// 	// 			orderId: this.orderId
				// 	// 		}
				// 	// 	}
				// 	// }).then((res) => {
				// 	// 	if (res.errorCode === '000000') {
				// 	// 		this.desc = res.record
				// 	// 		this.time = res.record.payTime
				// 	// 		this.getPrice()
				// 	// 		this.availableCoupons()
				// 	// 	} else {
				// 	// 		setTimeout(() => {
				// 	// 			uni.navigateBack({
				// 	// 				delta: 1
				// 	// 			})
				// 	// 		}, 100)
				// 	// 	}
				// 	// }).catch(() => {})
				// } else if (this.orderType == 3) {
				// 	this.$app.ajax({
				// 		api: this.$api.ticketsContinueToBePaid(),
				// 		data: {
				// 			userId: this.userInfo.id,
				// 			param: {
				// 				id: this.orderId
				// 			}
				// 		}
				// 	}).then((res) => {
				// 		if (res.errorCode === '000000') {
				// 			this.desc = res.record
				// 			this.time = res.record.payTime
				// 			this.getPrice()
				// 			this.availableCoupons()
				// 		} else {
				// 			setTimeout(() => {
				// 				uni.navigateBack({
				// 					delta: 1
				// 				})
				// 			}, 100)
				// 		}
				// 	}).catch(() => {})
				// } else if (this.orderType == 4) {
				// 	this.$app.ajax({
				// 		api: this.$api.mealsContinuePayInfo(),
				// 		data: {
				// 			userId: this.userInfo.id,
				// 			param: {
				// 				id: this.orderId
				// 			}
				// 		}
				// 	}).then((res) => {
				// 		if (res.errorCode === '000000') {
				// 			this.desc = res.record
				// 			this.time = res.record.payTime || res.record.remainTime
				// 			this.getPrice()
				// 			this.availableCoupons()
				// 		} else {
				// 			setTimeout(() => {
				// 				uni.navigateBack({
				// 					delta: 1
				// 				})
				// 			}, 100)
				// 		}
				// 	}).catch(() => {})
				// } else if (this.orderType == 6) {
				// 	this.$app.ajax({
				// 		api: this.$api.activityOrderInfoMini(),
				// 		data: {
				// 			userId: this.userInfo.id,
				// 			param: {
				// 				orderId: this.orderId
				// 			}
				// 		}
				// 	}).then((res) => {
				// 		if (res.errorCode === '000000') {
				// 			this.desc = res.record
				// 			this.time = res.record.surpluTime
				// 			this.getPrice()
				// 			this.availableCoupons()
				// 		} else {
				// 			setTimeout(() => {
				// 				uni.navigateBack({
				// 					delta: 1
				// 				})
				// 			}, 100)
				// 		}
				// 	}).catch(() => {})
				// } else if (this.orderType == 5) {
				// 	this.$app.ajax({
				// 		api: this.$api.goodsOrderDetail(),
				// 		data: {
				// 			userId: this.userInfo.id,
				// 			param: {
				// 				id: this.orderId
				// 			}
				// 		}
				// 	}).then((res) => {
				// 		if (res.errorCode === '000000') {
				// 			this.desc = res.record
				// 			this.getPrice()
				// 			this.availableCoupons()
				// 		} else {
				// 			setTimeout(() => {
				// 				uni.navigateBack({
				// 					delta: 1
				// 				})
				// 			}, 100)
				// 		}
				// 	}).catch(() => {})
				// } else if (this.orderType == 8) {
				// 	this.$app.ajax({
				// 		api: this.$api.appOrderDetial(),
				// 		data: {
				// 			param: {
				// 				orderId: this.orderId
				// 			}
				// 		}
				// 	}).then((res) => {
				// 		if (res.errorCode === '000000') {
				// 			this.desc = res.record
				// 			this.getPrice()
				// 			// this.availableCoupons()
				// 		} else {
				// 			setTimeout(() => {
				// 				uni.navigateBack({
				// 					delta: 1
				// 				})
				// 			}, 100)
				// 		}
				// 	}).catch(() => {})
				// }

			}

		}

	}
</script>
<style scoped lang="scss">
	.box_time {
		display: flex;
		align-items: center;
		background: $color;
		font-size: 30rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		box-sizing: border-box;
		padding: 30rpx 30rpx 110rpx;
		width: 100%;
		z-index: 0;
		color: #FFFFFF;

		image {
			width: 36rpx;
			height: 36rpx;
			margin-right: 12rpx;
		}
	}

	.box_info {
		background: #ffffff;
		padding: 30rpx;
		display: flex;
		flex-direction: column;
		width: 690rpx;
		box-sizing: border-box;
		border-radius: 8rpx;
		margin: -80rpx auto 20rpx;
		z-index: 100;

		.venue {
			font-size: 26rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #222222;

			image {
				width: 30rpx;
				margin-right: 10rpx;
				height: 30rpx;
			}
		}
	}

	.box_info_date {
		display: flex;
		align-items: center;
		margin-top: 20rpx;
		margin-bottom: 30rpx;
	}

	.box_info_date text {
		font-size: 26rpx;
		font-weight: 400;
		color: $color;
	}

	.box_info_date image {
		width: 28rpx;
		height: 28rpx;
		margin-right: 12rpx;
	}


	.box_info_item {
		padding: 30rpx;
		background: rgba(255, 255, 255, 0.08);
		box-shadow: 0rpx 2rpx 20rpx 0rpx rgba(0, 0, 0, 0.1);
		border-radius: 16rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-top: 20rpx;

		.box_info_item_b {
			text-align: right;
			flex: 1;
		}

		text {
			&:nth-child(1) {
				font-size: 30rpx;
				font-weight: 400;
				color: #222222;
			}

			&:nth-child(2) {
				font-size: 24rpx;
				font-weight: 400;
				color: #222222;
				margin: 5rpx 0;
			}

			&:nth-child(3) {
				font-size: 24rpx;
				font-weight: 400;
				color: #999999;
			}
		}

		.box_info_content {
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			margin-left: 30rpx;

			text {
				&:nth-child(1) {
					font-size: 30rpx;
					font-weight: 400;
					color: #222222;
				}

				&:nth-child(2) {
					font-size: 24rpx;
					font-weight: 400;
					color: #222222;
					margin: 5rpx 0;
				}

				&:nth-child(3) {
					font-size: 24rpx;
					font-weight: 400;
					color: #999999;
				}
			}
		}

		image {
			width: 120rpx;
			height: 120rpx;
			flex: none;
		}

		.box_info_item_content {
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			margin-left: 30rpx;

			text {
				&:nth-child(1) {
					font-size: 30rpx;
					font-weight: 400;
					color: #222222;
				}

				&:nth-child(2) {
					font-size: 24rpx;
					font-weight: 400;
					color: #222222;
					margin: 5rpx 0;
				}

				&:nth-child(3) {
					font-size: 24rpx;
					font-weight: 400;
					color: #999999;
				}
			}
		}

		.box_info_item_a {
			flex: 4;
			display: flex;
			align-items: center;
			justify-content: space-between;
		}

		.box_info_price {
			display: flex;
			flex-direction: column;
			align-items: flex-end;

			text {
				&:nth-child(1) {
					font-size: 30rpx;
					font-weight: 600;
					color: $red;
				}

				&:nth-child(2) {
					font-size: 24rpx;
					font-weight: 400;
					color: #999999;
					margin-top: 8rpx;
				}
			}
		}
	}

	.box_mode {
		background: #ffffff;
		padding: 30rpx 30rpx 0rpx 30rpx;
		display: flex;
		width: 690rpx;
		margin: 0 auto 20rpx;
		box-sizing: border-box;
		flex-direction: column;
	}

	.box_mode_title text {
		font-size: 32rpx;
		font-weight: 600;
		color: #222222;
	}

	.box_mode_s {
		padding: 34rpx 0;
		display: flex;
		border-bottom: 1px solid #E5E5E5;
		justify-content: space-between;
	}

	.box_mode .box_mode_s:last-child {
		border: none !important;
	}

	.weui-cell__bd {
		display: flex;
	}

	.weui-cell__bd image {
		width: 40rpx;
		height: 40rpx;
	}

	.weui-cell__bd text:nth-child(2) {
		font-size: 30rpx;
		font-weight: 400;
		color: #333333;
		margin-left: 24rpx;
	}

	.weui-cell__bd text:nth-child(3) {
		font-size: 26rpx;
		font-weight: 400;
		color: #666666;
		margin-left: 24rpx;
	}

	.red {
		color: #E83D29
	}

	.reds {
		font-size: 32rpx !important;
		font-weight: bolder !important;
		color: #E83D29 !important;
	}

	.seizeAseat {
		height: 120rpx;
	}

	.box_active_footer {
		width: 100%;
		height: 120rpx;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		display: flex;
		justify-content: space-between;
		background: #ffffff;
	}

	.box_active_footer_money {
		flex: 1;
		display: flex;
		justify-content: center;
		flex-direction: column;
		margin-left: 30rpx;

		text {
			font-size: 28rpx;
			font-weight: 400;
			color: #222222;

			&:nth-child(2) {
				font-size: 24rpx;
				font-weight: 400;
				color: #666666;
				margin-top: 16rpx;
			}
		}
	}

	.box_active_footer_btn {
		width: 260rpx;
		flex: none;
		justify-content: center;

		view {
			width: 200rpx;
			background: $color;
			border-radius: 40rpx;
			border: 1rpx solid $color;
			font-size: 30rpx;
			font-family: PingFangSC-Medium, PingFang SC;
			font-weight: 500;
			color: #FFFFFF;
			line-height: 80rpx;
			text-align: center;
		}
	}

	.time_js {
		margin-top: 5rpx;
	}

	.my-icon {
		margin-right: 10rpx;
	}

	.weui-cell__hd {
		display: flex;
		align-items: center;
	}

	.weui-cell__hd text {
		font-size: 26rpx;
		font-weight: 400;
		color: #333333;
		margin-right: 10rpx;
	}

	.dbFlex {
		image {
			width: 84rpx;
			height: 84rpx;
			margin-right: 20rpx;
		}

		.dbRight {
			font-size: 30rpx;
			line-height: 1.5;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #222222;

			view {
				&:nth-of-type(2) {
					color: #666666;
					font-size: 26rpx;

					text {
						font-size: 32rpx;
						font-family: PingFangSC-Semibold, PingFang SC;
						font-weight: 600;
						color: $color;
						margin-right: 5rpx;
					}
				}
			}
		}
	}

	.syxm {
		font-size: 24rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #666666;
		margin-top: 20rpx;
		width: 100%;
	}

	.tcHj {
		width: 100%;
		font-size: 26rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #666666;
		margin-top: 30rpx;
		text-align: right;
		border-top: 1px solid #E5E5E5;
		padding-top: 30rpx;

		text {
			color: $red !important;
			font-size: 32rpx !important;
			font-weight: 600 !important;
		}
	}

	.cont {
		width: 690rpx;
		background: #FFFFFF;
		box-sizing: border-box;
		border-radius: 8rpx;
		margin: -80rpx 30rpx 30rpx;
		padding: 30rpx;

		.venueName {
			font-size: 26rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #222222;

			image {
				width: 30rpx;
				height: 30rpx;
				margin-right: 10rpx;
				vertical-align: middle;
			}
		}

		.cnt {
			font-size: 28rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			line-height: 40rpx;
			color: #333333;
			margin-top: 15rpx;

			text {
				font-size: 28rpx;
				font-family: PingFangSC-Medium, PingFang SC;
				font-weight: 500;
				color: #222222;

				&.yh {
					font-weight: 400;
					color: #333333;
				}
			}

			&:last-of-type {
				text {
					color: $red;
					font-size: 36rpx;
					font-family: PingFangSC-Medium, PingFang SC;
					font-weight: 500;
				}
			}
		}
	}

	.orderDetail {
		.detail {
			margin-top: 30rpx;
			align-items: flex-start;

			.left {
				width: 88rpx;
				height: 88rpx;
				border-radius: 8rpx;
				margin-right: 24rpx;
				flex: none;
			}

			.right {
				flex: 1;
				display: flex;
				flex-direction: column;
				justify-content: space-between;

				.name {
					font-size: 30rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #222222;

					text {
						font-size: 24rpx;
						font-family: PingFangSC-Regular, PingFang SC;
						font-weight: 400;
						color: #999999;
						text-decoration: line-through;
						margin-left: 10rpx;
					}
				}

				.time {
					font-size: 24rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					line-height: 36rpx;
					color: #999999;

					.ytk {
						width: 76rpx;
						text-align: center;
						line-height: 36rpx;
						margin-right: 15rpx;
						border-radius: 4rpx;
						border: 1rpx solid #E33950;
						font-size: 20rpx;
						font-family: PingFangSC-Regular, PingFang SC;
						font-weight: 400;
						color: #E33950;
					}
				}

				.tj {
					.price {
						font-size: 30rpx;
						font-family: PingFangSC-Regular, PingFang SC;
						font-weight: 400;
						color: #222222;

						text {
							font-size: 24rpx;
							font-family: PingFangSC-Regular, PingFang SC;
							font-weight: 400;
							color: #999999;
							text-decoration: line-through;
							margin-left: 10rpx;
						}

					}

					.num {
						font-size: 24rpx;
						font-family: PingFangSC-Regular, PingFang SC;
						font-weight: 400;
						color: #999999;

						.ytk {
							width: 76rpx;
							text-align: center;
							line-height: 36rpx;
							margin-right: 15rpx;
							border-radius: 4rpx;
							border: 1rpx solid #E33950;
							font-size: 20rpx;
							font-family: PingFangSC-Regular, PingFang SC;
							font-weight: 400;
							color: #E33950;
						}
					}
				}
			}
		}
	}

	.orderCont {
		width: 690rpx;
		background: #FFFFFF;
		box-sizing: border-box;
		border-radius: 16rpx;
		margin: 0 auto 30rpx;
		padding: 30rpx;

		view {
			font-size: 24rpx;
			font-family: PingFangSC-Regular, PingFang SC;
			font-weight: 400;
			color: #999999;
			line-height: 1;
			margin-bottom: 30rpx;
			display: flex;
			justify-content: space-between;

			&.bt {
				font-size: 30rpx;
				font-family: PingFangSC-Semibold, PingFang SC;
				font-weight: 600;
				color: #222222;
			}

			&:last-of-type {
				margin-bottom: 0;
			}

		}
	}
</style>